package io.gitee.yth.design.pattern.test.core.pattern.behavioral.visitor.visitor;

import io.gitee.yth.design.pattern.test.core.pattern.behavioral.visitor.element.BooleanElement;
import io.gitee.yth.design.pattern.test.core.pattern.behavioral.visitor.element.IntegerElement;
import io.gitee.yth.design.pattern.test.core.pattern.behavioral.visitor.element.StringElement;

/**
 * @author yth
 * @since 2023-04-29-16:37
 */
public class HashCodeVisitor implements Visitor {

    @Override
    public void visitInteger(IntegerElement e) {
        final int hashCode = e.getValue().hashCode();
        System.out.println("HashCodeVisitor >> visit integer: " + hashCode);
    }

    @Override
    public void visitBoolean(BooleanElement e) {
        final int hashCode = e.getValue().hashCode();
        System.out.println("HashCodeVisitor >> visit boolean: " + hashCode);
    }

    @Override
    public void visitString(StringElement e) {
        final int hashCode = e.getValue().hashCode();
        System.out.println("HashCodeVisitor >> visit string: " + hashCode);
    }
}
